package com.campus.commons.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

@Data
@NoArgsConstructor
@AllArgsConstructor
@TableName(value = "goodclass")
public class GoodClass implements Serializable {
    private Integer id;
    @TableField("className")
    private String className;
    @TableField("checkClassWork")
    private Integer checkClassWork;
    @TableField("checkClassDate")
    private String checkClassDate;
    @TableField("checkEveningDate")
    private String checkEveningDate;
    @TableField("checkEveningIsRed")
    private Integer checkEveningIsRed;
    @TableField("checkHealthIsRed")
    private Integer checkHealthIsRed;
    @TableField("checkHealthDate")
    private String checkHealthDate;
    @TableField("checkMorningDate")
    private String checkMorningDate;
    @TableField("checkMorningWork")
    private Integer checkMorningWork;
    @TableField("teacherId")
    private Integer teacherId;
    @TableField("formalWork")
    private String formalWork;
    @TableField("checkHealthScore")
    private Integer checkHealthScore;
    @TableField("checkDormScore")
    private Integer checkDormScore;
    @TableField("checkDormDate")
    private String checkDormDate;
    @TableField(exist = false)
    private String teacherName;

    public Integer getTeacherId() {
        return teacherId;
    }

    public void setTeacherId(Integer teacherId) {
        Teacher teacher = Teacher.teachers.get(teacherId);
        teacherName = teacher.getTeachername() == null ? "无" : teacher.getTeachername();
        this.teacherId = teacherId;
    }
}
